#include "Memento.h"


void Originator::SetState(const State& state)
{
	a_state = state;
}

void Originator::SetMemento(Memento* pMemento)
{
	a_state = pMemento->GetState();
}

Memento* Originator::CreateMemento()
{
	return new Memento(a_state);
}

void Originator::PrintState()
{
	cout << "state: " << a_state <<endl;
}

State Memento::GetState()
{
	return a_state;
}
